package com.hptpd.questionnairesurvey.controller.admin;

import com.hptpd.questionnairesurvey.component.Result;
import com.hptpd.questionnairesurvey.domain.Department;
import com.hptpd.questionnairesurvey.service.IDepartmentService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * \* Created with IntelliJ IDEA.
 * \* Date: 2019/9/10
 * \*
 * \* Description:
 * \
 *
 * @author walter_long
 */
@RestController
@RequestMapping("/api/admin")
public class DepartmentController {
    @Resource(name = "iDepartmentService")
    private IDepartmentService iDepartmentService;

    @RequestMapping(value = "/department/list", method = RequestMethod.GET)
    public Result listDepartmentUnderParentDepartment(@RequestParam Integer id){
        Department department = new Department();
        department.setId(id);
        return iDepartmentService.listDepartmentUnderParentDepartment(department);
    }
}
